package com.acme.bankapp.domain.bank;


public abstract class AbstractAccount implements Account{
	
	private double balance;
	
	public AbstractAccount(){
		this(0);
	}

	public AbstractAccount(double balance) {
		super();
		this.balance = balance;
	}
	
	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}

	public void deposit(double x){
		this.balance += x;
	}
	
	public void withdraw(double x){
		if(x >= 0 &&this.balance>=x)
			this.balance -= x;
	}
	
	public double maximumAmountToWithdraw() {
		return getBalance();
	}


}

